struct fragment
{
	float4 position  : POSITION;
	float4 color0    : COLOR0;
	float2 texcoord0 : TEXCOORD0;
};

struct pixel
{
	float4 color : COLOR;
};

pixel main( fragment IN,
		    const uniform sampler2D texture,
		    const uniform sampler2D texture2,
			const uniform float1 time)
{
	pixel OUT;

	float localtime = time;

	float multiply = 1.3+0.3*sin(time*18);

	float2 uv = IN.texcoord0;
	uv.x += time*0.5;
	uv.y += time*0.5;
//	float4 texelcolor = tex2D(texture, IN.texcoord0);
//	float4 texelcolor2 = tex2D(texture2, IN.texcoord0*multiply);
	float4 texelcolor = tex2D(texture, uv);
	float4 texelcolor2 = tex2D(texture2, uv*multiply);

	texelcolor = texelcolor*0.7 + texelcolor2*0.8;
	texelcolor *= 1.55;
	texelcolor += 0.16*sin(localtime*16);
	texelcolor *= texelcolor;

	OUT.color = texelcolor * IN.color0;
	return OUT;

	
	
	
}
